<template>
  <el-select size="mini" v-if="field === 'level'" v-model="value">
    <el-option label="A" value="A" />
    <el-option label="B" value="B" />
    <el-option label="C" value="C" />
    <el-option label="D" value="D" />
  </el-select>
  <el-input v-else  size="mini" :placeholder="placeholder" v-model="value" />
</template>

<script>
export default {
  name: "avue-sport-score",
  model: {
    prop: "text", //指向props的参数名
    event: "input", //事件名称
  },
  props: ["placeholder","bind","cell","column","disabled","label","prop","text","type" ],
  computed: {
    field() {
      return this.bind.replace(this.prop + ".", "");
    },
    value: {
      set(val) {
        const { credits, level, marker, scores } = this.text || {};
        const v = { credits, level, marker, scores };
        v[this.field] = val;
        this.$emit("input", v);
      },
      get() {
        return this.text[this.field];
      },
    },
  },
};
</script>
